import { createRouter, createWebHistory } from 'vue-router'
import NormalLayout from '@/layout/NormalLayout.vue'
import HomeView from '../views/HomeView.vue'
import LoginPage from '@/views/LoginPage.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      component: LoginPage
    },
    {
      path: '/',
      component: NormalLayout,
      redirect: '/home',
      children: [
        {
          path: 'home',
          name: 'home',
          component: HomeView
        },
        {
          path: 'userManager',
          name: 'userManager',
          component: () => import('@/views/user/UserManage.vue')
        }
      ]
    },
    {
      path: '/:pathMatch(.*)',
      name: 'NotFindPage',
      component: () => import('@/views/error/NotFindPage.vue')
    }
  ]
})

export default router
